package ntd.tool;

import cn.hutool.core.util.HexUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import cn.hutool.log.StaticLog;

public class ToolHex {

    public static int[] strToIntBytes(String str) {
        String hexStr = HexUtil.encodeHexStr(str);
        String[] split = StrUtil.split(hexStr, 2);
        int[] intBytes = new int[split.length];
        for (int i = 0; i < split.length; i++) {
            intBytes[i] = HexUtil.hexToInt(split[i]);
        }
        return intBytes;
    }

    public static void main(String[] args) {
        StaticLog.info(JSONUtil.toJsonStr(strToIntBytes("dfdsfasdgdasg")));
    }
}
